package com.kaigejava.webmaginc;


import us.codecraft.webmagic.Page;
import us.codecraft.webmagic.Site;
import us.codecraft.webmagic.Spider;
import us.codecraft.webmagic.processor.PageProcessor;

/**
 * 简单demo1
 * @author kaigejava
 */
public class SimpleDemo1 implements PageProcessor {

    public void process(Page page) {
        System.out.println(page.getHtml().toString());
    }

    public Site getSite() {
        return Site.me().setSleepTime(100).setRetryTimes(3);
    }

    public static void main(String[] args) {
        Spider.create(new SimpleDemo1()).addUrl("https://blog.csdn.net/").run();
    }
}
